#ifndef WAYPOINTWIDGET_H
#define WAYPOINTWIDGET_H

#include <QWidget>
#include <QtGui>
#include "constants.h"

// Виджет для отображения путевой точки.

enum RouteState {NotRoute, FirstPoint, MiddlePoint, EndPoint};

class WayPointWidget : public QWidget
{
    Q_OBJECT
public:
    WayPointWidget(unsigned long aID, QWidget* parent = 0, Qt::WindowFlags fl = Qt::SplashScreen);
    ~WayPointWidget();
    void draw(QPainter *painter);
    unsigned long ID;
    RouteState state;
    void setOwnVisibility(const bool&);
    void setItem(QGraphicsProxyWidget*);
    void setPosition(const int&, const int&);
    int getX(void) const;
    int getY(void) const;
private:
    QGraphicsProxyWidget *item;
    int x,y;
protected:
    void paintEvent(QPaintEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *);
signals:
    void Edited(const unsigned long&);
};

#endif // WAYPOINTWIDGET_H
